html, body, #main {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

@phone-width: 1000px;
#main {
  display: flex;
  @media screen and (max-width: @phone-width) {
    flex-direction: column;
    & > * {
      width: 100%;
    }

    .view {
      height: 50%;
    }

    .input {
      height: 50%;
    }
  }
  @media screen and (min-width: @phone-width) {
    & > * {
      height: 100%;
    }

    .view {
      width: 50%;
    }

    .input {
      width: 50%;
    }
  }

}


.view {
  background: black;
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;

  .mid {
    display: flex;
  }

  .face {
    display: flex;
    flex-direction: column;
    border-style: solid;
    border-width: 1px;

    & > div { //每行
      display: flex;
      flex-direction: row;
    }

    .cell {
      border-style: solid;
      border-color: black;
      border-width: 1px;
      box-sizing: border-box;
    }
  }
}


.input {
  @control-height: 2rem;
  overflow: hidden; //因为使用了rem，导致textarea的高度总是不合适
  .control {
    height: @control-height;
    display: flex;
    flex-direction: row;

    & > * {
      width: 100%;
      font-size: 1rem;
    }
  }


  textarea {
    width: 100%;
    height: calc(100% - @control-height);
    font-size: 1rem;
    font-family: Consolas, serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    resize: none;
    outline: none;
  }
}


#toast { //toast应该充满父元素，作为一个遮罩而存在
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;

  .box {
    font-size: 1.5rem;
    padding: 0.5rem;
    opacity: 0.8;
    background: white;
    border-radius: 0.5rem;
    white-space: pre;
    max-height: 100%;
    overflow: auto;
    box-sizing: border-box;
  }
}

